import {theme} from "../../common/theme.js";

/**
 * NavBar 组件样式
 * 提供顶部导航栏的完整样式，包括搜索框、菜单按钮、响应式设计等
 */
export const css = `
    /* 导航栏主容器 - 固定在页面顶部 */
    .nav-bar {
      width: 100%;
      height: ${theme.topHeight};
      background-color: ${theme.bgc};
      position: fixed;
      top: 0;
      margin-bottom: ${theme.topMarginBottom};
    
      /* 新增：让子元素居中 */
      display: flex;
      align-items: center;         /* 垂直居中 */
      
      /* 其他建议 */
      box-sizing: border-box;
      left: ${theme.leftMenuWidth}; /* 与LeftMenu宽度对应 */
      right: 0;
      z-index: 999;
      transition: left 0.3s ease, width 0.3s ease;
      border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        
      
    }

    .nav-content {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      max-width: 1200px;
      margin: 0 auto;
      gap: 20px;
      position: relative;
    }

    .nav-content search-frame {
      flex: 1;
      max-width: 600px;
      margin: 0 auto;
    }

    .nav-bar .menu-toggle {
      display: none;
      background: none;
      border: none;
      color: #fff;
      font-size: 24px;
      cursor: pointer;
      padding: 8px;
      border-radius: 4px;
      transition: background-color 0.3s ease;
      position: absolute;
      left: 20px;
    }

    .nav-bar .menu-toggle:hover {
      background-color: rgba(255, 255, 255, 0.1);
    }

    /* 平板设备 */
  @media (max-width: 1024px) {
    .nav-bar {
      left: 240px; /* 与LeftMenu宽度对应 */
      padding: 0 15px;
    }

    .nav-content {
      gap: 15px;
    }

    .nav-content search-frame {
      max-width: 450px;
    }
  }

  /* 移动设备 - 横屏 */
  @media (max-width: 768px) {
    .nav-bar {
      left: 0;
      width: 100%;
      padding: 0 15px;
    }

    .nav-bar .menu-toggle {
      display: block;
    }

    .nav-content {
      gap: 12px;
      margin-left: 50px; /* 为汉堡菜单留出空间 */
    }

    .nav-content search-frame {
      max-width: 250px;
    }
  }

    .nav-content search-frame {
      max-width: 250px;
    }
  }

  /* 移动设备 - 竖屏 */
  @media (max-width: 480px) {
    .nav-bar {
      height: 60px;
      padding: 0 10px;
    }

    .nav-bar .menu-toggle {
      font-size: 20px;
      left: 10px;
    }

    .nav-content {
      gap: 8px;
      margin-left: 45px;
      margin-right: 10px;
    }

    .nav-content search-frame {
      max-width: 180px;
      flex: 1;
    }
  }

  /* 超小屏幕 */
  @media (max-width: 320px) {
    .nav-bar {
      height: 50px;
      padding: 0 8px;
    }

    .nav-bar .menu-toggle {
      font-size: 18px;
      left: 8px;
    }

    .nav-content {
      gap: 6px;
      margin-left: 40px;
      margin-right: 8px;
    }

    .nav-content search-frame {
      max-width: 150px;
    }
  }
`